package com.forenow.demo.demo20;

public class PayrollSystem {
    public static void main(String[] args) {
        Mydata mydata1=new Mydata(1998,01,10);
        Mydata mydata2=new Mydata(1997,05,27);
        HourlyEmployee hourlyEmployee=new HourlyEmployee();
        hourlyEmployee.setHour(10);
        hourlyEmployee.setWage(20);
        int hourlysal=hourlyEmployee.earning();
        SalariedEmployee salariedEmployee=new SalariedEmployee();
        salariedEmployee.setMonthlySalary(5200);
        int salar=salariedEmployee.getMonthlySalary();
        Employee e1=new HourlyEmployee("tom",1,mydata1.toDateString(),hourlysal*30);
        Employee e2=new SalariedEmployee("Cindy",2,mydata2.toDateString(),salar);

        Employee[] arr={e1,e2};
        for (int i = 0; i <2 ; i++) {
            System.out.println(arr[i].getName()+"---"+arr[i].getNumber()+"---"+arr[i].getBirthday()+"---"+arr[i].getSal());
        }
    }
}
